﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace UI.ShopManagement
{
    public partial class FrmBas1a03 : UI.ParentForm.BaseMain
    {
        FrmBas1a03Edit edit = null;

        public FrmBas1a03(string modulecode, string action)
            : base(modulecode, action)
        {
            InitializeComponent();

            this.tspView.Visible = false;
        }

        protected override void OnAddClick(ToolStripButton btn)
        {
            edit = new FrmBas1a03Edit("A", GetTitleStyle(this.Text, btn.Text), "");
            edit.ShowDialog();
            if (edit.IsReload) base.BindGrid();
        }

        protected override void UpdatePager(UI.Common.Pager pager)
        {
            pager.FilterAppName = "muser";
        }

        protected override void OnEditClick(ToolStripButton btn, DataGridViewRow row)
        {
            OpenEdit("M", btn.Text, Components.Validation.ToString(row.Cells["listid"].Value));
        }
        private void OpenEdit(string action, string btnText, string code)
        {
            edit = new FrmBas1a03Edit(action, GetTitleStyle(this.Text, btnText), code);
            edit.ShowDialog();
            if (edit.IsReload) base.BindGrid();
        }

    }
}
